package otrasPruebas;

public class CalculadoraImplem implements Calculadora {

	private int a;
	private int b;
	private int c;
	
	public CalculadoraImplem() {
		a = 0;
		b = 0;
		c = 0;
	}
	
	public CalculadoraImplem(int num1, int num2) throws NegNumberException {
		a = num1;
		if (num1<0) {
			throw new NegNumberException();
		}
		if (num2<0) {
			throw new NegNumberException();
		}
		b = num2;
		c = 0;
	}
	
	@Override
	public void Suma() {
		c=a+b;
	}
	
	@Override
	public void Resta() {
		c=a-b;
	}
	
	@Override
	public void Multip() {
		c=a*b;
	}
	
	@Override
	public void Divisi() {
		c=a/b;
	}
	
	@Override
	public void Reset() {
		c=0;
	}
	
	public int GetResult() {
		return c;
	}
	
}
